#ifndef LOGININFO_H
#define LOGININFO_H
#include "BaseEntity.h"
class LoginInfo : public BaseEntity{
public:
    qlonglong infoId;
    QString userName;
    QString status;
    QString ipaddr;
    QString loginLocation;
    QString browser;
    QString os;
    QString msg;
    QString loginTime;
    QJsonObject toJson() const {
        QJsonObject obj;
        obj["infoId"] = infoId;
        obj["userName"] = userName;
        obj["status"] = status;
        obj["ipaddr"] = ipaddr;
        obj["loginLocation"] = loginLocation;
        obj["browser"] = browser;
        obj["os"] = os;
        obj["msg"] = msg;
        obj["loginTime"] = loginTime;
        obj["searchValue"] = searchValue;
        obj["createBy"] = createBy;
        obj["createTime"] = createTime;
        obj["updateBy"] = updateBy;
        obj["updateTime"] = updateTime;
        obj["remark"] = remark;
        return obj;
    }

    static LoginInfo toLoginInfo(const QJsonObject &obj) {
        LoginInfo loginInfo;
        loginInfo.infoId = obj["infoId"].toVariant().toLongLong();
        loginInfo.userName = obj["userName"].toString();
        loginInfo.status = obj["status"].toString();
        loginInfo.ipaddr = obj["ipaddr"].toString();
        loginInfo.loginLocation = obj["loginLocation"].toString();
        loginInfo.browser = obj["browser"].toString();
        loginInfo.os = obj["os"].toString();
        loginInfo.msg = obj["msg"].toString();
        loginInfo.loginTime = obj["loginTime"].toString();
        loginInfo.searchValue = obj["searchValue"].toString();
        loginInfo.createBy = obj["createBy"].toString();
        loginInfo.createTime = obj["createTime"].toString();
        loginInfo.updateBy = obj["updateBy"].toString();
        loginInfo.updateTime = obj["updateTime"].toString();
        loginInfo.remark = obj["remark"].toString();
        return loginInfo;
    }
};

#endif // LOGININFO_H
